package com.kp.fintech.admin.controller;

import com.kp.fintech.admin.service.SysHomeService;
import com.kp.fintech.core.http.HttpResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.kp.fintech.core.page.PageRequest;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 首页内容获取
 */
@RestController
@RequestMapping("/sys/home")
public class SysHomeController {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    SysHomeService sysHomeService;

    @PostMapping(value = "/findPage")
    public HttpResult findPage(@RequestBody PageRequest pageRequest) {
        int pageNum = pageRequest.getPageNum();
        int pageSize = pageRequest.getPageSize();
        logger.debug("****pageNum is {} , pageSize is {} ",pageNum,pageSize);
        return HttpResult.ok(sysHomeService.findPage(pageRequest));
    }

}
